package com.example.demo.pojo.entity;

import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

import java.time.LocalDateTime;

@Getter
@Setter
@ToString
public class Admin {
    private Long id;

    @NotBlank(message = "管理员用户名不能为空")
    @Length(min = 1, max = 20, message = "名称长度限定为1-20个字符")
    private String username;

    @NotBlank(message = "密码不能为空")
    @Length(min = 6, max = 20, message = "密码长度限定为6-20个字符")
    private String password;

    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    public Admin() {
    }

    public Admin(Long id, String username, String password, LocalDateTime createTime, LocalDateTime updateTime) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
}
